import { getUserinfoApi } from "@/api";
import NavBar from "@/components/menus/NavBar";
import { UserType } from "@/types";
import { FixedView, Loading } from "@taroify/core";
import { useLoad, useRouter } from "@tarojs/taro";
import { useState } from "react";
import FollowUser from "@/components/common/FollowUser";
import { View } from "@tarojs/components";
import SendTools from "@/components/common/SendTools";

export default () => {
  //   const router = useRouter();
  //   console.log(router.params.id); // 参数接收
  const [target, setTarger] = useState<UserType>();
  useLoad(() =>
    getUserinfoApi("1864273892504383489").then((res: any) => {
      setTarger(res);
    })
  );
  return (
    <>
      {target && (
        <NavBar title={target.username}>
          <FollowUser id="1864273892504383489" />
          <SendTools />
        </NavBar>
      )}
    </>
  );
};
